const StorageUtil = {
  save: function (key: string, data: any) {
    localStorage.setItem(key, data && typeof data === 'object' ? JSON.stringify(data) : data);
  },
  get: function (key: string, _default?: any) {
    return localStorage.getItem(key) || _default || null;
  },

  remove: function remove(key: string) {
    return localStorage.removeItem(key);
  },
};

export default StorageUtil;
